package com.realdolmen.jcc.mobileSquad.service
{
	import com.realdolmen.jcc.mobileSquad.domain.Customer;
	
	import mx.collections.ArrayCollection;
	
	/**
	 * The high-level Customer business interface.
	 * @author DOMSIEBE
	 */	
	public interface CustomerService{
		/**
		 * Populate with dummy data.
		 */		
		function populate():void;
		
		/**
		 * Save a Customer.
		 * @param customer The customer to save.
		 */		
		function save(customer:Customer):void;
		
		/**
		 * Update a customer.
		 * @param customer The customer to update.
		 */		
		function update(customer:Customer):void;
		
		/**
		 * Remove a customer.
		 * @param customer The customer to remove.
		 */		
		function remove(customer:Customer):void;
		
		/**
		 * Get the next Customer in the list.
		 * If the end of the list is reached <code>null</code> is returned.
		 * @param customer The "index" customer
		 * @return The next Customer in the list
		 */		
		function next(customer:Customer):Customer;
		
		/**
		 * Get the previous Customer in the list.
		 * If the beginning of the list is reached <code>null</code> is returned.
		 * @param customer The "index" customer
		 * @return The previous Customer in the list
		 */		
		function previous(customer:Customer):Customer;
		
		/**
		 * Find all customers.
		 */		
		function findAll():void;
		
		/**
		 * Search for companies that match a portion of the company name. 
		 * Example: cor will result in a list with Corelio.
		 * @param companyName A part of the company name.
		 */		
		function search(companyName:String):void;
		
		/**
		 * Complete customer information.
		 * TODO:
		 * - Use following api to complete address information: http://code.google.com/apis/ajax/playground/#center_localsearch
		 * - Use following api to logo information: http://code.google.com/apis/ajax/playground/#imagetype_restriction
		 * @param customer The customer to complete.
		 */		
		function completeCustomer(customer:Customer):void;
	}
}